
/**
 * Created by zhao on 17-1-23.
 */

//创建tab 在center
function createTabOnCenter(title,url) {
    var boolean = $('#tabs').tabs('exists',title);
    if (boolean){
        //更新该tab
        $('#tt').tabs('update', {
            tab: title,
            type:'body'
        });
        //选择该tab
        $('#tabs').tabs('select',title);
    }else{
        //创建tab
        $('#tabs').tabs('add',{
            title:title,
            href:url,
            closable:true
        })
    }
}

/**
 * 创建panel在east
 * @param title panel标题
 * @param iconCls panel图标
 * @param url panel远程访问链接
 */
function createPanelOnEast(title,iconCls,url) {
    var $east = $('#east');
    //判断是否有panel已经存在
    if ($('#eastPanel').size()==0){
        $('<div id="eastPanel"></div>').appendTo('#east');
    }else{
        $('#eastPanel').panel('open');
    }
    $('#eastPanel').panel({
        title:title,
        iconCls:iconCls,
        fit:true,
        closable:true,
        href:url
    })
}

function toAddress(address){
    window.location= address;
}


